package cn.classyex.business.hr.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.classyex.business.hr.mapper.AttendanceDetailMapper;
import cn.classyex.business.hr.domain.AttendanceDetail;
import cn.classyex.business.hr.service.IAttendanceDetailService;
import com.ruoyi.common.core.text.Convert;

/**
 * 考勤详情管理Service业务层处理
 * 
 * @author yex
 * @date 2021-05-06
 */
@Service
public class AttendanceDetailServiceImpl implements IAttendanceDetailService 
{
    @Autowired
    private AttendanceDetailMapper attendanceDetailMapper;

    /**
     * 查询考勤详情管理
     * 
     * @param attendanceDetailId 考勤详情管理ID
     * @return 考勤详情管理
     */
    @Override
    public AttendanceDetail selectAttendanceDetailById(Long attendanceDetailId)
    {
        return attendanceDetailMapper.selectAttendanceDetailById(attendanceDetailId);
    }

    /**
     * 查询考勤详情管理列表
     * 
     * @param attendanceDetail 考勤详情管理
     * @return 考勤详情管理
     */
    @Override
    public List<AttendanceDetail> selectAttendanceDetailList(AttendanceDetail attendanceDetail)
    {
        return attendanceDetailMapper.selectAttendanceDetailList(attendanceDetail);
    }

    /**
     * 新增考勤详情管理
     * 
     * @param attendanceDetail 考勤详情管理
     * @return 结果
     */
    @Override
    public int insertAttendanceDetail(AttendanceDetail attendanceDetail)
    {
        attendanceDetail.setCreateTime(DateUtils.getNowDate());
        return attendanceDetailMapper.insertAttendanceDetail(attendanceDetail);
    }

    /**
     * 修改考勤详情管理
     * 
     * @param attendanceDetail 考勤详情管理
     * @return 结果
     */
    @Override
    public int updateAttendanceDetail(AttendanceDetail attendanceDetail)
    {
        attendanceDetail.setUpdateTime(DateUtils.getNowDate());
        return attendanceDetailMapper.updateAttendanceDetail(attendanceDetail);
    }

    /**
     * 删除考勤详情管理对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAttendanceDetailByIds(String ids)
    {
        return attendanceDetailMapper.deleteAttendanceDetailByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除考勤详情管理信息
     * 
     * @param attendanceDetailId 考勤详情管理ID
     * @return 结果
     */
    @Override
    public int deleteAttendanceDetailById(Long attendanceDetailId)
    {
        return attendanceDetailMapper.deleteAttendanceDetailById(attendanceDetailId);
    }
}
